package com.handle.system.web.controller;

import com.handle.common.core.result.JsonResult;
import com.handle.system.api.dto.SysTenantDto;
import com.handle.system.api.service.ISysTenantService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhangqing
 * @description 租户控制层
 * @date 2021/4/26 8:00 下午
 */
@RestController
@RequestMapping("/tenant")
@AllArgsConstructor
@Api(tags = "SysTenantController", value = "租户控制层")
public class SysTenantController {
    private final ISysTenantService sysTenantService;

    @ApiOperation("获取租户信息")
    @GetMapping("/info")
    public JsonResult tenantInfo(){
        List<SysTenantDto> sysTenantDtos = sysTenantService.selectTenantByUser();
        return JsonResult.success(sysTenantDtos);
    }
}
